import request from "@/utils/request";

/**
 * 获取全部路由列表,且包含树结构。传分页参数则返回分页数据
 */
export function getRouters(data) {
  return request({
    url: `/api/router/list`,
    method: "get",
    params: data
  });
}

/**
 * 添加或修改路由
 */
export function saveOrUpdateRouter(data) {
  return request({
    url: "/api/router/save",
    method: "post",
    data
  });
}

/**
 * 根据id删除路由
 */
export function deleteRouter(data) {
  return request({
    url: `/api/router/delete`,
    method: "get",
    params: data
  });
}
